import { bizHttp, type IRes } from '@/utils/request/index';
import type { LoginForm, UserInfo } from '@/store/type';
import type { loginRes, RouterRes } from './type';

// 登录
export function loginRequest(data: LoginForm) {
	return bizHttp.post<IRes<loginRes>>({
		url: '/user/login',
		data
	});
}
// 获取用户信息
export function getUserInfoById(params: { id: number }) {
	return bizHttp.get<IRes<UserInfo>>({
		url: '/user/userinfo',
		params
	});
}
// 获取路由列表
export function getUserRouterList(params: { id: number }) {
	return bizHttp.get<IRes<RouterRes[]>>({
		url: '/user/routers',
		params
	});
}
